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,GAAAmB,EAAAC,IAAA,EAACC,EAAAA,CAAUA,CAAAA,CACTzB,MAAOqB,EACPK,OAAQzB,EACR0B,WAAYzB,EACZ0B,WAAYzB,EACZhB,WAAYA,EACZkB,cACEY,CAAAA,CAAAA,GAA2BhC,kBAAAA,EAAKmC,IAAI,GAEhCf,EAENC,WAAYA,EACZC,WAAYA,EACZsB,SAAUpC,EAAYM,MAAM,CAC5BJ,aAAcA,EACdmC,SAAUb,GAA2BhC,kBAAAA,EAAKmC,IAAI,CAC9CxB,OAAQA,YAEPJ,GACCuC,CAAAA,EAAAA,EAAAA,CAAAA,EACEvC,EACAD,EACAM,cAAAA,EAA2BR,EAAkB2C,KAAAA,EAC7Cf,GAGH1B,MAAAA,EAAAA,KAAAA,EAAAA,EAAiB0C,GAAG,CAAC,CAACC,EAASC,IAC9B,GAEED,EAAQnC,MAAM,CAACY,QAAQ,CAACyB,UAAU,CAChC,kDAIA,GAAAb,EAAAc,GAAA,EAACC,EAAAA,CAAeA,CAAAA,CAEdC,gBAAiB,UACjBC,SAAU,GACVC,UAAW,GACXC,cAAe,GACfC,iBAAkB,YAElB,GAAApB,EAAAc,GAAA,EAACO,EAAAA,CAAiBA,CAAAA,CAChBC,UAAWX,EAASnC,MAAM,CAA2BY,QAAQ,CAC7DmC,QAASZ,EAASnC,MAAM,CAA2B+C,OAAO,CAC1DC,UAAWb,EAASnC,MAAM,CAA2BgD,SAAS,IAV3D,WAAaC,MAAA,CAAFb,IAgBpB,GAAAZ,EAAAc,GAAA,EAACY,EAAAA,CAAqBA,CAAAA,CAEpBf,QAASA,GADJ,WAAac,MAAA,CAAFb,KAKrBzC,GAAiB,GAAA6B,EAAAc,GAAA,EAACa,EAAAA,CAAYA,CAAAA,CAAE,GAAGxD,EAAcK,MAAM,KAG9D","sources":["webpack://_N_E/?15c3","webpack://_N_E/./pages/docfleck/[slug].tsx","webpack://_N_E/"],"sourcesContent":["\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/docfleck/[slug]\",\n function () {\n return require(\"private-next-pages/docfleck/[slug].tsx\");\n }\n ]);\n if(module.hot) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/docfleck/[slug]\"])\n });\n }\n ","import safeStringify from \"fast-safe-stringify\";\n\nimport { GetStaticPaths, GetStaticProps, NextPage } from \"next\";\nimport { useSearchParams } from \"next/navigation\";\n\nimport { useEffect } from \"react\";\n\nimport { ContentfulNavigation } from \"../../@types/contentfulNavigation\";\nimport {\n IContentSectionFields,\n IPageFields,\n} from \"../../@types/generated/contentful\";\nimport { getHero } from \"../../app/[slug]/component\";\nimport CustomContainer from \"../../components/container\";\nimport ContentSectionWrapper from \"../../components/content-section-wrapper\";\nimport CountdownBar from \"../../components/countdown-bar\";\nimport PageLayout from \"../../components/page/layout\";\nimport SubscriptionPanel from \"../../components/subscrption-panel\";\nimport {\n TableOfContentsEntry,\n getTableOfContentsFromPage,\n} from \"../../components/table-of-contents\";\nimport getContentfulContentTypeEntries from \"../../utils/contentful/getContentfulContentTypeEntries\";\nimport getContentfulPage from \"../../utils/contentful/getContentfulPage\";\nimport generateTitle from \"../../utils/page/generateTitle\";\nimport getJointPageProperties, {\n JointPageProperties,\n} from \"../../utils/page/getJointPageProperties\";\nimport { DOC_FLECK_TENANT_NAME } from \"../../utils/tenant-names\";\nimport { isDocFleckTenantPage } from \"../../utils/tenants\";\n\ninterface PageProps {\n isPreview?: boolean;\n page: IPageFields;\n previewData?: any;\n navigation: ContentfulNavigation;\n jointPageProperties: JointPageProperties;\n tableOfContents: TableOfContentsEntry[];\n}\n\n/**\n * Top level page\n * @param {PageProps} props\n * @param {IPageFields} props.page\n * @returns JSX.Element\n */\nconst Page: NextPage = ({\n isPreview,\n page,\n previewData,\n navigation,\n jointPageProperties,\n tableOfContents,\n}: PageProps) => {\n const {\n contentSections,\n heroTeaser,\n seoMetadata,\n countdownPage,\n noNavigation,\n tenant,\n pageType,\n paywall,\n } = page;\n const {\n fields: { title },\n } = seoMetadata;\n const { footerProps } = jointPageProperties;\n const {\n logoDark,\n logoLight,\n titleSuffix,\n bannerVisible,\n bannerText,\n bannerIcon,\n } = jointPageProperties.siteSettings;\n\n const searchParams = useSearchParams();\n\n useEffect(() => {\n if (isPreview && previewData?.internal !== \"\") {\n const previewElement = document.getElementById(previewData.internal);\n if (previewElement) {\n previewElement.scrollIntoView({ behavior: \"smooth\" });\n }\n }\n }, [isPreview, previewData.internal]);\n\n const plusSalespageSlugs = [\n \"doc-fleck-plus\",\n \"das-neue-plus\",\n \"migration-sp-hs\",\n ];\n const isDocFleckPlusSalespage = plusSalespageSlugs.includes(page.slug);\n\n const fullTitle = generateTitle(title, titleSuffix);\n\n return (\n \n {heroTeaser &&\n getHero(\n heroTeaser,\n contentSections,\n pageType == \"Fleckxikon\" ? tableOfContents : undefined,\n isDocFleckPlusSalespage\n )}\n\n {contentSections?.map((section, i) => {\n if (\n isDocFleckPlusSalespage &&\n section.fields.internal.startsWith(\n \"Doc Fleck Plus - Salespage - Abo-Auswahl-Modul\"\n )\n ) {\n return (\n \n \n \n );\n }\n return (\n \n );\n })}\n {countdownPage && }\n \n );\n};\n\nexport default Page;\n\n/**\n * This function gets called at build time to pre-fetch the routes of the course pages\n * @returns {Promise<{paths: {params: {slug: string}}[], fallback: boolean}>}\n */\nexport const getStaticPaths: GetStaticPaths = async () => {\n // Call contentful API endpoint to get course pages\n const pages = await getContentfulContentTypeEntries({\n contentType: \"page\",\n filter: {\n \"fields.tenant\": \"docfleck\",\n \"fields.isRecipe[ne]\": \"true\",\n },\n }).then((entries) => entries.items.map((entry) => entry.fields));\n\n // Filter out tenant pages\n const tenantPages = pages.filter((page) => isDocFleckTenantPage(page));\n const nonRecipePages = tenantPages.filter((page) => !page.isRecipe);\n // Get the paths we want to pre-render based on the pages\n const paths = nonRecipePages.map((page) => ({\n params: {\n slug: page.slug,\n },\n }));\n\n // We'll pre-render only these paths at build time.\n // { fallback: false } means other routes should 404.\n return { paths, fallback: false };\n};\n\n/**\n * This function gets called at build time on server-side to statically pre-fetch the data for the page\n * @param {GetStaticPropsContext} context\n * @returns page data\n */\nexport const getStaticProps: GetStaticProps = async (context) => {\n const [page, jointPageProperties] = await Promise.all([\n getContentfulPage({\n // get page slug from context\n slug: context.params?.slug?.toString() || \"\",\n isPreview: context.preview || false,\n previewData: context.previewData,\n }),\n getJointPageProperties(context, DOC_FLECK_TENANT_NAME),\n ]);\n\n // if no page was found, return 404\n if (!page) {\n return { notFound: true };\n }\n\n let tableOfContents = getTableOfContentsFromPage(page.fields);\n\n const propsData = safeStringify({\n page: page.fields,\n isPreview: context.preview || false,\n previewData: context.previewData || {\n env: process.env.NEXT_PUBLIC_CONTENTFUL_ENV,\n internal: \"\",\n },\n navigation: jointPageProperties.navigation,\n jointPageProperties,\n theme: DOC_FLECK_TENANT_NAME,\n tableOfContents,\n });\n\n const props = JSON.parse(propsData);\n\n // pass page data to the page via props\n return {\n props,\n };\n};\n"],"names":["window","__NEXT_P","push","__webpack_require__","__webpack_exports__","isPreview","page","previewData","navigation","jointPageProperties","tableOfContents","param","contentSections","heroTeaser","seoMetadata","countdownPage","noNavigation","tenant","pageType","paywall","fields","title","footerProps","logoDark","logoLight","titleSuffix","bannerVisible","bannerText","bannerIcon","siteSettings","useSearchParams","useEffect","internal","previewElement","document","getElementById","scrollIntoView","behavior","isDocFleckPlusSalespage","plusSalespageSlugs","includes","slug","fullTitle","generateTitle","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","jsxs","PageLayout","footer","logoHeader","logoFooter","metadata","noHeader","getHero","undefined","map","section","i","startsWith","jsx","CustomContainer","backgroundColor","isStroke","fullWidth","lowTopPadding","lowBottomPadding","SubscriptionPanel","sectionId","heading","introText","concat","ContentSectionWrapper","CountdownBar"],"sourceRoot":""}